<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>爱贝儿医</title>
	<link rel="stylesheet" href="http://demo.open.weixin.qq.com/jssdk/css/style.css?ts=1420774989">
	<script src="//res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<link rel="stylesheet" href="business/style/vote/style/vote1.css?<?=time()?>">
	<!--<link rel="stylesheet" type="text/css" href="business/style/vote/style/normalize.css" />
    <link rel="stylesheet" type="text/css" href="business/style/vote/style/default.css">-->
<!--    <script src="business/style/vote/js/minigrid.js" ></script>-->
	<script src="app/js/common.js"></script>
	<script src="business/js/jquery.js"></script>
    <script src="business/style/vote/js/vote.js"></script>
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
</head>
<body>

	<header id="div"  <?php if(!isset($_GET['id'])): ?> style="background: url('<?=G_SITE_CDN?>/business/style/vote/style/vote_bg_list1.jpg') no-repeat top #fff;text-align:center;display:block;background-size: 100%;" <?php endif;?> >
		<input type="hidden" value="<?=$vote_id?>"  name="vote_id" />
		<input type="hidden" value="<?=$vote_re_id?>" name="vote_re_id">
		<input type="hidden" value="<?=$_GET['id']?>" id="id_hidden"/>
		<input type="hidden" value="<?=$ajax_vote_url?>" id="url"/>

		<div class="logo"><img src="<?=G_SITE_CDN?>/business/style/vote/style/vote_logo4.png" alt="" style="width:240px; height:32px; " /></div>
		<div class="logo_txt"><img src="http://static.tianshiyumiao.com/research/business/style/vote/style/vote_txt.png" alt="" /></div>
	   <?php if(isset($_GET['id'])): ?>
	<div class="logo_vote_txt">今日最美儿科医生</div>
		<div class="avatar"><img src="<?=G_SITE_CDN?>/<?=$dc_detail->data['head_img']?>" alt="" /></div>
		<h1><?=$dc_detail->data['name']?></h1>
		<h2><?=$dc_detail->data['zhicheng']?></h2>
		<h2><?=$dc_detail->data['hospital']?> <?=$dc_detail->data['keshi']?></h2>
	</header>
	<!--内容-->
	<div class="vote_content">
		<div class="vote_content_title">
			<div class="vote_content_title_line"></div><span>| TA的故事</span>
		</div>
		<!--图文消息-->
		<div class="vote_content_container">
			<?=$this->preg_img_cdn($dc_detail->data['descript_story'])?>
		</div>
		<!--图文消息-->
		<!--查看图文消息更多按钮-->
		<div class="vote_content_container_more">
			<img src="<?=G_SITE_CDN?>/business/style/vote/style/vote_arrow1.png" alt="" />
		</div>
		<!--查看图文消息更多按钮-->
		<div id="now_vote_show" style="text-align: center; font-size: 80%; color: #CCCCCC;">
			当前票数:<span id="now_vote_num<?=$dc_detail->data['id']?>" ><?=$dc_detail->data['vote_num']?></span>
		</div>
		<!--给她投票按钮-->

		<div class="gtvate_btn">
			<span id="btn">
				<img id="I_vote" src="<?=G_SITE_CDN?>/business/style/vote/style/gtvoteN.png" alt="" />
			</span>
		</div>
		<!--给她投票按钮-->
		<!--我要推荐-->
		<div class="go_recommend"><a href="http://d.eqxiu.com/s/d2Ykzt3m"><strong>我要推荐</strong></a><!--<a href="<?=$vote_recommend_url?>"><strong>我要推荐</strong></a>--></div>
		<!--我要推荐-->
		<!--活动规则-->
		<div class="vote_activity">
			<h2>本活动最终解释权归爱贝儿医所有</h2>
		</div>
		<!--活动规则-->
	</div>
	<!--瀑布流-->
	<div class="vote_ad_ewm">
		
		<img src="<?=G_SITE_CDN?>/business/style/vote/style/vote_ewm.png" alt="" class="vote_ewm"/>
		<p><span>识别上方二维码关注爱贝儿医</span></p>
		<a href="http://www.meadjohnson.com.cn/" class="vote_ad_a" ><img src="<?=G_SITE_CDN?>/business/style/vote/style/vote_ad.png" alt="" class="vote_ad"/></a>
	</div>
<?php endif;?>
	<?php if(!isset($_GET['id'])): ?>
	</header>
	<?php endif;?>
	<div class="container">
		<div class='footerheight'></div>
		<script>
		function imgLocation(){  //将小数转换成整数
		    var boxArr = [];
		    var G_SITE_BASE = "<?=G_SITE_BASE?>"+"/";
		    var G_SITE_CDN = "<?=G_SITE_CDN?>"+"/";
		    var vote_index_url ="<?=$vote_index_url?>";	    
		    boxWidthn=$(window).width()*0.47;
			var data = <?=json_encode($vote_list)?>;
			$.each(data,function(index,value) {
				var boxitem = '<div class="box"><div class="content"><div class="grid-item"><a href="'+vote_index_url+'&id='+value['id']+'"><div class="grid-item_img"><img src="'+G_SITE_CDN+''+value['img']+'" alt="" /></div><h1>'+value['name']+'</h1><h2>'+value['hospital']+'</h2></a><div class="grid-item-agree"><input type="hidden" id="id_for" value="'+value['id']+'"><span id="vote_num'+value['id']+'">'+value['vote_num']+'</span><img  id="img'+value['id']+'"  src="'+G_SITE_CDN+'business/style/vote/style/voteN.png" class="boxImgclass" alt="" data-height="'+value['img_height']+'" data-width="'+value['img_width']+'"/></div></div></div></div>';
				$(".container").append(boxitem)
				boxHeighty = value['img_height'];
				boxWidthy = value['img_width'];
				var boxHeight = boxHeighty*boxWidthn/boxWidthy+136.09;
		        if(index<2){
		            boxArr[index] = boxHeight;
		        }else{
		            var minboxHeight = Math.min.apply(null,boxArr);
		            var minboxIndex = $.inArray(minboxHeight,boxArr);
		          
		            $(".box").eq(index).css({
		                'position':'absolute',
		                'top':minboxHeight,
		                'left':$(".box").eq(minboxIndex).position().left
		            });
		            boxArr[minboxIndex] += boxHeight;
		            $(".footerheight").css("top",boxArr[minboxIndex]);
		       };
		 	})
			$(".container").append("<div class='clear'></div>")
			
		};
		$(document).ready(function(){
			imgLocation();
			 $(window).on("scroll", function() {
			            var scrollTop = $(document).scrollTop();
			            var itemOffTop = $(".container").offset().top+$(".container").height();
			            if(scrollTop>=itemOffTop){
			                $(".footerheight").show();
			            }else{
			                $(".footerheight").hide();
			            }
			})
		})
		</script>
    </div>

	<!--瀑布流-->
	<!--内容-->
	<!--留言-->
	<div class="vote_leave_msg_bg"></div>
	<div class="vote_leave_msg">
		<div class="vote_leave_msg_header"><img src="<?=G_SITE_CDN?>/business/style/vote/style/doc_vote_header.png" alt="" /></div>
		<div class="vote_leave_msg_con">
			<form action="<?=$vote_leave_url?>"  method="post" id="form11">
				<input type="hidden" value="<?=@$_GET['id']?>" name="bd_id"/>
				<p for="" class="vote_label">
					给<?=$dc_detail->data['name']?>留言：<span>(选填)</span>
				</p>
				<div class="textareak"><textarea name="content" rows="" cols="" class="vote_textarea"></textarea></div>
				<input type="radio" class="parent" name="people" checked="checked" value="0"/>
				<input type="radio" class="doctor" name="people" value="1"/>
				<div class="vote_radio vote_parent vote_parentH">我是孩子家长</div>
				<div class="vote_radio vote_doctor">我是医生</div>
				<input type="number" name="tel" placeholder="点此输入您的手机号" class="vote_tel"/>
				<p class="tel_txt">填写手机号有机会获得30M~200M手机流量哦~<br><span>活动最终解释权归爱贝儿医所有</span></p>
				<input type="submit" class="vote_Submit" value="确定并提交"/>
				<div class="vote_close"><img src="<?=G_SITE_CDN?>/business/style/vote/style/doc_close_icon.png" alt="" onclick="closevote()"/></div>
			</form>
		</div>
	</div>
	<!--留言-->
	<div class="footer">
		<a href="http://d.eqxiu.com/s/d2Ykzt3m?from=singlemessage&isappinstalled=0"><img src="<?=G_SITE_CDN?>/business/style/vote/style/recommendFooter.png" alt="" class="recommendFooter"></a>
	</div>
</body>
<?php require 'app/templates/common/foot.html'; ?>
</html>
<script>
window.ready=function(){
	$(".vote_leave_msg_bg").css("height",$(document).height());
}

wx.config({
	debug: false,
	appId: '<?php echo $this->signPackage["appId"];?>',
	timestamp: '<?php echo $this->signPackage["timestamp"];?>',
    nonceStr: '<?php echo $this->signPackage["nonceStr"];?>',
	signature: '<?php echo $this->signPackage["signature"];?>',
	jsApiList: [
	'onMenuShareAppMessage',
	'onMenuShareTimeline',
	'onMenuShareQQ',
	'onMenuShareWeibo',
	'onMenuShareQZone'
]
});

title = '<?=$title?>';
desc = '发现生命之美，评选儿科之最';
links = '<?=$url?>';
imgUrl = '<?=$img?>';
weixinShare(title, desc, links, imgUrl);

</script>
